Skip to content

Comments

refactor: simplify embeded pg#120

Merged
tianzhou merged 6 commits intomainfrom
simplify
Oct 24, 2025
Merged

refactor: simplify embeded pg#120
tianzhou merged 6 commits intomainfrom
simplify

Conversation

@tianzhou
Copy link
Contributor

No description provided.

Copilot AI review requested due to automatic review settings October 23, 2025 11:04
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR consolidates embedded PostgreSQL functionality by moving all related code from cmd/util and ir packages into testutil, making it available for both testing and production use. The refactoring eliminates code duplication and establishes testutil as the single source of truth for embedded PostgreSQL management.

Key Changes:

  • Moved embedded PostgreSQL management, version detection, and test helper functions from cmd/util and ir packages to testutil
  • Updated all imports and references across the codebase to use testutil instead of cmd/util for embedded PostgreSQL functionality
  • Added support for nil testing.T parameter to enable usage in production code and TestMain contexts

Reviewed Changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
testutil/postgres.go Added comprehensive embedded PostgreSQL functionality including version detection, instance management, and test helpers
ir/testutil.go Removed (functionality moved to testutil package)
ir/testing.go Added convenience wrappers that delegate to testutil functions
cmd/util/postgres_version.go Removed (functionality moved to testutil)
cmd/util/postgres_version_test.go Removed (tests moved to testutil)
cmd/util/embedded_postgres.go Removed (functionality moved to testutil)
cmd/util/embedded_postgres_test.go Removed (tests moved to testutil)
cmd/util/embedded_postgres_test_helper.go Removed (functionality moved to testutil)
cmd/plan/plan.go Updated imports to use testutil instead of util for embedded PostgreSQL
cmd/apply/apply.go Updated imports to use testutil instead of util for embedded PostgreSQL
cmd/migrate_integration_test.go Updated imports and type references to use testutil
cmd/apply/apply_integration_test.go Updated imports and type references to use testutil

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@tianzhou tianzhou force-pushed the simplify branch 3 times, most recently from fb392a4 to db0587a Compare October 23, 2025 11:56
@tianzhou tianzhou requested a review from Copilot October 23, 2025 17:18
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 20 out of 20 changed files in this pull request and generated 2 comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@tianzhou tianzhou requested a review from Copilot October 23, 2025 18:10
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 20 out of 20 changed files in this pull request and generated 4 comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@tianzhou tianzhou requested a review from Copilot October 24, 2025 10:50
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 20 out of 20 changed files in this pull request and generated 1 comment.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 20 out of 20 changed files in this pull request and generated 4 comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@tianzhou tianzhou merged commit 1e0638a into main Oct 24, 2025
2 checks passed
@tianzhou tianzhou deleted the simplify branch November 23, 2025 14:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant